// const BASE_URL = 'https://digital.essc.top/svzjl';
// const BASE_URL = 'https://digital.essc.top/sv01';
// const BASE_URL = 'https://14e502668g.zicp.fun/sv01';
// const BASE_URL = 'https://3451m7y168.goho.co/sv01';
const app = getApp()
export default function request({url,data,method='GET',login=false}){
    return new Promise((resolve,reject)=>{
        uni.request({
            url: app.globalData.Domain_Name + url,
            data:data.data,
            header: {
            	'Content-Type': 'application/x-www-form-urlencoded'
            },
            method,
            success: ({ data, statusCode, header }) => {
				if(header.redirect=='REDIRECT'||login){
					resolve(header)
				}else{
					resolve(data)
				}
            },
            fail: (error) => {
                reject(error)
            }
        })
    })
}